FROM openjdk:8-jdk-alpine
# alpine linux apk 的安装源改为国内镜像
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
# 解决图片验证码 解决字体问题
RUN apk add --update ttf-dejavu fontconfig && rm -rf /var/cache/apk/*
VOLUME /tmp
ARG GIT_COMMIT=0
ENV GIT_COMMIT=${GIT_COMMIT}
LABEL GIT_COMMIT=${GIT_COMMIT}
LABEL description="https://www.qekang.com"
MAINTAINER https://blog.csdn.net/qierkang
ADD target/lancaster-service-1.0.0-SNAPSHOT.jar /lancaster-service.jar
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' >/etc/timezone
ENV PORT 8888
ENV JAVA_OPTS="-XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=256m -Xms128m -Xmx512m -Xmn256m -Xss256k -XX:SurvivorRatio=8 -XX:+UseConcMarkSweepGC -XX:CompileCommand=exclude,org/hibernate/cfg/annotations/SimpleValueBinder,setType"
CMD java -jar -Duser.timezone=GMT+08 ${JAVA_OPTS} /lancaster-service.jar -p $PORT